using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace CHEnhanceEfCore.Models
{
    /// <summary>
    /// author: chenhao
    /// </summary>
    [Table("user")]
    public class User : BaseModel
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        [Key]
        [Column("user_id")]
        public Guid userId { get; set; }

        /// <summary>
        /// 用户帐号
        /// </summary>
        [Column("user_name")]
        [MaxLength(36)]
        public string username { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Column("password")]
        [MaxLength(36)]
        public string password { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [Column("nick_name")]
        [MaxLength(32)]
        public string nickName { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        [Column("phone_number")]
        [MaxLength(36)]
        public string phoneNumber { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [Column("email")]
        [MaxLength(64)]
        public string email { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [Column("avatar")]
        [MaxLength(128)]
        public string avatar { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Column("sex")]
        public char sex { get; set; }

        /// <summary>
        /// 用户类型
        /// </summary>
        [Column("user_type")]
        public int userType { get; set; }

        /// <summary>
        /// 是否激活
        /// </summary>
        [Column("is_active")]
        public int isActive { get; set; } = 1;

        /// <summary>
        /// 是否删除
        /// </summary>
        [Column("is_deleted")]
        public int isDeleted { get; set; } = 0;
    }
}